package com.uniriho.p2pconnectiontest;

import android.Manifest;
import android.app.Activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;


public class MainActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            requestPermissions(new String[]{Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO}, 100);
        }
        findViewById(R.id.btn_local_demo).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(MainActivity.this, LocalDemoActivity.class));
            }
        });
        findViewById(R.id.btn_p2p_demo).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
//                startActivity(new Intent(MainActivity.this, P2PDemoActivity.class));
//                startActivity(new Intent(MainActivity.this, P2PDemoClientActivity.class));
                startActivity(new Intent(MainActivity.this, P2PDemoServerActivity.class));
            }
        });
        findViewById(R.id.btn_multiple_demo).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(MainActivity.this, MultipleDemoActivity.class));
            }
        });
    }
}